package com.yenlien.traceyun.business.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.yenlien.traceyun.webase.entity.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "t_user")
@Data
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class UserBusiness extends BaseEntity {

    private String milkName;    // 奶站名称
    private String address;     // 奶站地址


    public enum UserType {
        ADMIN, //管理员
        COMPANY, //企业用户
        GOV,//政府用户
        AGENT,//代理商
        COMMON //普通用户
    }

    @Column(name = "company_id", length = 32)
    private String companyId;
    @Column(name = "department_id", length = 32)
    private String departmentId;
    @Transient
    private String department;
    //姓名
    @Column(name = "name", length = 20)
    private String name;
    //登录名      奶站负责人
    @Column(name = "username", length = 20)
    private String username;

    //密码
    @Column(name = "password", length = 32)
    private String password;

    //性别
    @Column(name = "gender", length = 10)
    private String gender;

    @Column(name = "id_card", length = 18)
    private String idCard; //身份证号码

    //手机   负责人账号
    @Column(name = "phone", length = 13)
    private String phone;

    //邮箱
    @Column(name = "email", length = 20)
    private String email;

    //用户类型
    @Enumerated(EnumType.STRING)
    @Column(name = "user_type", length = 10)
    private UserType userType;

    //创建时间
    @JsonIgnore
    @Column(name = "createtime")
    public Date createtime;

    //更新时间
    @JsonIgnore
    @Column(name = "updatetime")
    public Date updatetime;

    //账号是否被锁定
    @Column(name = "locked")
    private boolean locked;

    @Column
    private String headImg;      //头像

    @Column(name = "education", length = 10)
    private String education;    //学历

    @Column(name = "jobtime")
    private Date jobtime;    //入职时间
    @Transient
    private String query;


}

